#include <cmath>
#include <iostream>
#include <unordered_set>
#include <vector>
using namespace std;

unordered_set<int> st;
unordered_set<int> ans;
string trans(int num) {
    string ans = "";
    for (int i = 9; i >= 0; i--) {
        int bit = num / pow(4, i);
        switch (bit) {
            case 0:
                ans += 'A';
                break;
            case 1:
                ans += 'C';
                break;
            case 2:
                ans += 'G';
                break;
            case 3:
                ans += 'T';
                break;
            default:
                cout << bit << endl;
        }
        num %= (int)pow(4, i);
    }
    return ans;
}
vector<string> findRepeatedDnaSequences(string s) {
    int sub = 0;
    for (int i = 0; i < 10; i++) {
        sub *= 4;
        switch (s[i]) {
            case 'A':
                sub += 0;
                break;
            case 'C':
                sub += 1;
                break;
            case 'G':
                sub += 2;
                break;
            case 'T':
                sub += 3;
                break;
            default:
                cout << "hello" << endl;
        }
    }
    st.insert(sub);
    for (int i = 10; i < s.length(); i++) {
        sub %= (int)pow(4, 9);
        sub *= 4;
        switch (s[i]) {
            case 'A':
                sub += 0;
                break;
            case 'C':
                sub += 1;
                break;
            case 'G':
                sub += 2;
                break;
            case 'T':
                sub += 3;
                break;
            default:
                cout << "hello" << endl;
        }
        if (st.count(sub))
            ans.insert(sub);
        else
            st.insert(sub);
    }
    vector<string> ret;
    for (int num : ans) { ret.push_back(trans(num)); }
    return ret;
}